{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="{% static "stark/bootstrap/css/bootstrap.css" %}"/>
    <style>
        ul > li .active {
            background-color: #336699;
            color: white;
        }

        .list-filter a {
            display: inline-block;
            padding: 3px 6px;
            border: 1px solid #336699;
            margin: 3px 0;
        }

        .list-filter a.active {
            background-color: #336699;
            color: white;
        }

        .form-group {
            margin-top: 10px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>列表页面</h1>
    <div class="list-filter">
        {% for filter_row in  cl.gen_comb_filter %}
            <div>
                {% for col in filter_row %}
                    {{ col }}
                {% endfor %}
            </div>
        {% endfor %}

    </div>
<div>
    {% if cl.show_search_form %}
        <div class="form-group">
            <form method="get">
                <input name="{{ cl.config.search_key }}" value="{{ cl.search_form_val }}" class="form-control"
                       placeholder="请输入搜索条件" type="text" style="display:inline-block;width: 200px;"/>
                <button class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>

            </form>
        </div>
    {% endif %}
</div>
    <form method="post">
        {% csrf_token %}
        <div style="float: left;margin-bottom: 0px">
            {% if cl.show_add_btn %}
                <a class="btn btn-primary" href="{{ cl.add_url }}">添加</a>
            {% endif %}
        </div>
        <div class="pull-right" style="margin-bottom: -15px">
            {% if cl.show_actions %}
                <div class="form-group">
                    <select name="list_action" class="form-control" style="display:inline-block;width: 200px;">
                        {% for item in cl.modify_actions %}
                            <option value="{{ item.name }}">{{ item.text }}</option>
                        {% endfor %}

                    </select>
                    <button class="btn btn-primary">执行</button>
                </div>
            {% endif %}
        </div>
        <table class="table table-bordered table-hover table-striped">
            <thead>
            <tr>
                {% for item in cl.head_list %}
                    <th>{{ item }}</th>
                {% endfor %}
            </tr>
            </thead>
            <tbody>
            {% for obj in cl.body_list %}
                <tr>
                    {% for col in obj %}
                        <td>{{ col }}</td>
                    {% endfor %}
                </tr>
            {% endfor %}
            </tbody>
        </table>
    </form>


    <div class="pull-right">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li>{{ cl.page_obj.page_html|safe }}</li>
            </ul>
        </nav>
    </div>
</div>
</body>
</html>